home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Blogowanie poza sfera / Flock 1.0 beta / flock-1.0RC3.en-US.win32.exe / flock / components / flockPhotoAlbum.js < prev    next >
Text File  |  2007-10-18  |  2KB  |  81 lines

  1. //
  2. // BEGIN FLOCK GPL
  3. // 
  4. // Copyright Flock Inc. 2005-2007
  5. // http://flock.com
  6. // 
  7. // This file may be used under the terms of of the
  8. // GNU General Public License Version 2 or later (the "GPL"),
  9. // http://www.gnu.org/licenses/gpl.html
  10. // 
  11. // Software distributed under the License is distributed on an "AS IS" basis,
  12. // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. // for the specific language governing rights and limitations under the
  14. // License.
  15. // 
  16. // END FLOCK GPL
  17. //
  18.  
  19. const FLOCK_PHOTO_ALBUM_CID = Components.ID('{01879f96-3974-41ba-92b8-7e77dbbe5da7}');
  20. const FLOCK_PHOTO_ALBUM_CONTRACTID = '@flock.com/photo-album;1';
  21. const FLOCK_PHOTO_ALBUM_IID = Components.interfaces.flockIPhotoAlbum;
  22.  
  23.  
  24. function flockPhotoAlbum() {
  25. }
  26.  
  27. flockPhotoAlbum.prototype= {
  28.     id: "",
  29.     title: "",
  30.     url: "",
  31.  
  32.     QueryInterface: function(iid) {
  33.         if (!iid.equals(Components.interfaces.nsISupports) &&
  34.             !iid.equals(FLOCK_PHOTO_ALBUM_IID))
  35.             throw Components.results.NS_ERROR_NO_INTERFACE;
  36.         return this;
  37.     }
  38. };
  39.  
  40.  
  41. var flockPhotoAlbumModule = {
  42.     registerSelf: function(compMgr, fileSpec, location, type) {
  43.         compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  44.         compMgr.registerFactoryLocation(FLOCK_PHOTO_ALBUM_CID, 
  45.                                         "flockPhotoAlbum JS component", 
  46.                                         FLOCK_PHOTO_ALBUM_CONTRACTID, 
  47.                                         fileSpec, 
  48.                                         location,
  49.                                         type);
  50.     },
  51.  
  52.     getClassObject: function(compMgr, cid, iid) {
  53.         if (!cid.equals(FLOCK_PHOTO_ALBUM_CID))
  54.             throw Components.results.NS_ERROR_NO_INTERFACE;
  55.  
  56.         if (!iid.equals(Components.interfaces.nsIFactory))
  57.             throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  58.  
  59.         return flockPhotoAlbumFactory;
  60.     },
  61.  
  62.     canUnload: function(compMgr) { return true; }
  63. };
  64.  
  65. var flockPhotoAlbumFactory = {
  66.     createInstance: function(outer, iid) {
  67.         if (outer != null)
  68.             throw Components.results.NS_ERROR_NO_AGGREGATION;
  69.     
  70.         if (!iid.equals(FLOCK_PHOTO_ALBUM_IID) &&
  71.             !iid.equals(Components.interfaces.nsISupports))
  72.             throw Components.results.NS_ERROR_INVALID_ARG;
  73.  
  74.         return new flockPhotoAlbum();
  75.     }
  76. }
  77.  
  78. /* module initialisation */
  79. function NSGetModule(comMgr, fileSpec) { return flockPhotoAlbumModule; }
  80.  
  81.